/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import hilog from '@ohos.hilog';
import { NativeModuleRegistry } from './NativeModuleRegistry';
import { ReactInstanceManagerService } from '../ReactInstanceManagerService'

export class ReactContextService {
  private static readonly TAG = "ReactContextService"
  private mNativeModuleRegistry: NativeModuleRegistry
  //private mInstanceManager: ReactInstanceManagerService = new ReactInstanceManagerService()

  constructor() {
    hilog.info(0x0000, ReactContextService.TAG, 'constructor')
  }

  public setNativeModuleRegistry(nativeModuleRegistry: NativeModuleRegistry) {
    hilog.info(0x0000, ReactContextService.TAG, 'setNativeModuleRegistry')
    this.mNativeModuleRegistry = nativeModuleRegistry
  }

  public getNativeModuleRegistry(): NativeModuleRegistry {
    if (!this.mNativeModuleRegistry) {
      hilog.info(0x0000, ReactContextService.TAG, 'getNativeModuleRegistry is null')
    }
    return this.mNativeModuleRegistry
  }
}
